home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 2002 November
/
SGI Freeware 2002 November - Disc 2.iso
/
dist
/
fw_groff.idb
/
usr
/
freeware
/
catman
/
u_man
/
cat1
/
ggrn.Z
/
ggrn
Wrap
Text File
|
2002-04-08
|
16KB
|
346 lines
GRN(1) GRN(1)
NNAAMMEE
grn - groff preprocessor for gremlin files
SSYYNNOOPPSSIISS
ggrrnn [ --CCvv ] [ --TT_d_e_v ] [ --MM_d_i_r ] [ --FF_d_i_r ] [ _f_i_l_e_._._. ]
It is possible to have whitespace between a command line
option and its parameter.
DDEESSCCRRIIPPTTIIOONN
_g_r_n is a preprocessor for including _g_r_e_m_l_i_n pictures in
_g_r_o_f_f input. _g_r_n writes to standard output, processing
only input lines between two that start with ..GGSS and ..GGEE..
Those lines must contain _g_r_n commands (see below). These
commands request a _g_r_e_m_l_i_n file, and the picture in that
file is converted and placed in the _t_r_o_f_f input stream.
The ..GGSS request may be followed by a C, L, or R to center,
left, or right justify the whole _g_r_e_m_l_i_n picture (default
justification is center). If no _f_i_l_e is mentioned, the
standard input is read. At the end of the picture, the
position on the page is the bottom of the _g_r_e_m_l_i_n picture.
If the _g_r_n entry is ended with ..GGFF instead of ..GGEE, the
position is left at the top of the picture.
Please note that currently only the -me macro package has
support for ..GGSS, ..GGEE, and ..GGFF.
The following command-line options are understood:
--TT_d_e_v Prepare output for printer _d_e_v. The default device
is ppss. See ggrrooffff(1) for acceptable devices.
--MM_d_i_r Prepend _d_i_r to the default search path for _g_r_e_m_l_i_n
files. The default path is (in that order) the
current directory, the home directory, //uussrr//ffrreeee
wwaarree//lliibb//ggrrooffff//ssiittee--ttmmaacc, //uussrr//ffrreeee
wwaarree//sshhaarree//ggrrooffff//ssiittee--ttmmaacc, and //uussrr//ffrreeee
wwaarree//sshhaarree//ggrrooffff//11..1177..22//ttmmaacc.
--FF_d_i_r Search _d_i_r for subdirectories ddeevv_n_a_m_e (_n_a_m_e is the
name of the device) for the DDEESSCC file before the
normal //uussrr//ffrreeeewwaarree//sshhaarree//ggrrooffff//11..1177..22//ffoonntt.
--CC Recognize ..GGSS and ..GGEE (resp. ..GGFF) even when fol
lowed by a character other than space or newline.
--vv Print the version number.
GGRRNN CCOOMMMMAANNDDSS
Each input line between ..GGSS and ..GGEE may have one _g_r_n com
mand. Commands consist of one or two strings separated by
white space, the first string being the command and the
second its operand. Commands may be upper or lower case
and abbreviated down to one character.
Commands that affect a picture's environment (those listed
before ddeeffaauulltt, see below) are only in effect for the cur
rent picture: The environment is reinitialized to the
defaults at the start of the next picture. The commands
are as follows:
11 _N
22 _N
33 _N
44 _N Set _g_r_e_m_l_i_n's text size number 1 (2, 3, or 4) to _N
points. The default is 12 (resp. 16, 24, and 36).
rroommaann _f
iittaalliiccss _f
bboolldd _f
ssppeecciiaall _f
Set the roman (italics, bold, or special) font to
_t_r_o_f_f's font _f (either a name or number). The
default is R (resp. I, B, and S).
ll _f
ssttiippppllee _f
Set the stipple font to _t_r_o_f_f's stipple font _f
(name or number). The command ssttiippppllee may be
abbreviated down as far as `st' (to avoid confusion
with ssppeecciiaall). There is _n_o default for stipples
(unless one is set by the default command), and it
is illegal to include a _g_r_e_m_l_i_n picture with poly
gons without specifying a stipple font.
xx _N
ssccaallee _N
Magnify the picture (in addition to any default
magnification) by _N, a floating point number larger
than zero. The command ssccaallee may be abbreviated
down to `sc'.
nnaarrrrooww _N
mmeeddiiuumm _N
tthhiicckk _N
Set the thickness of _g_r_e_m_l_i_n's narrow (resp. medium
and thick) lines to _N times 0.15pt (this value can
be changed at compile time). The default is 1.0
(resp. 3.0 and 5.0), which corresponds to 0.15pt
(resp. 0.45pt and 0.75pt). A thickness value of
zero selects the smallest available line thickness.
Negative values cause the line thickness to be pro
portional to the current point size.
ppooiinnttssccaallee _<_o_f_f_/_o_n_>
Scale text to match the picture. Gremlin text is
usually printed in the point size specified with
the commands 11, 22, 33, or 44 regardless of any scal
ing factors in the picture. Setting ppooiinnttssccaallee
will cause the point sizes to scale with the pic
ture (within _t_r_o_f_f's limitations, of course). An
operand of anything but _o_f_f will turn text scaling
on.
ddeeffaauulltt
Reset the picture environment defaults to the set
tings in the current picture. This is meant to be
used as a global parameter setting mechanism at the
beginning of the _t_r_o_f_f input file, but can be used
at any time to reset the default settings.
wwiiddtthh _N
Forces the picture to be _N inches wide. This over
rides any scaling factors present in the same pic
ture. `wwiiddtthh _0' is ignored.
hheeiigghhtt _N
Forces picture to be _N inches high, overriding
other scaling factors. If both `width' and
`height' are specified the tighter constraint will
determine the scale of the picture. HHeeiigghhtt and
wwiiddtthh commands are not saved with a ddeeffaauulltt com
mand. They will, however, affect point size scal
ing if that option is set.
ffiillee _n_a_m_e
Get picture from _g_r_e_m_l_i_n file _n_a_m_e located the cur
rent directory (or in the library directory; see
the --MM option above). If two ffiillee commands are
given, the second one overrides the first. If _n_a_m_e
doesn't exist, an error message is reported and
processing continues from the ..GGEE line.
NNOOTTEESS AABBOOUUTT GGRROOFFFF
Since _g_r_n is a preprocessor, it doesn't know about current
indents, point sizes, margins, number registers, etc.
Consequently, no _t_r_o_f_f input can be placed between the ..GGSS
and ..GGEE requests. However, _g_r_e_m_l_i_n text is now processed
by _t_r_o_f_f, so anything legal in a single line of _t_r_o_f_f
input is legal in a line of _g_r_e_m_l_i_n text (barring `.'
directives at the beginning of a line). Thus, it is pos
sible to have equations within a _g_r_e_m_l_i_n figure by includ
ing in the _g_r_e_m_l_i_n file _e_q_n expressions enclosed by previ
ously defined delimiters (e.g. _$_$).
When using _g_r_n along with other preprocessors, it is best
to run _t_b_l before _g_r_n, _p_i_c, and/or _i_d_e_a_l to avoid over
working _t_b_l. _E_q_n should always be run last.
A picture is considered an entity, but that doesn't stop
_t_r_o_f_f from trying to break it up if it falls off the end
of a page. Placing the picture between `keeps' in -me
macros will ensure proper placement.
_g_r_n uses _t_r_o_f_f's number registers gg11 through gg99 and sets
registers gg11 and gg22 to the width and height of the _g_r_e_m_l_i_n
figure (in device units) before entering the ..GGSS request
(this is for those who want to rewrite these macros).
GGRREEMMLLIINN FFIILLEE FFOORRMMAATT
There exist two distinct _g_r_e_m_l_i_n file formats, the origi
nal format from the _A_E_D graphic terminal version, and the
_S_U_N or _X_1_1 version. An extension to the _S_U_N/_X_1_1 version
allowing reference points with negative coordinates is nnoott
compatible with the _A_E_D version. As long as a _g_r_e_m_l_i_n
file does not contain negative coordinates, either format
will be read correctly by either version of _g_r_e_m_l_i_n or
_g_r_n. The other difference to the _S_U_N/_X_1_1 format is the
use of names for picture objects (e.g., POLYGON, CURVE)
instead of numbers. Files representing the same picture
are shown in Table 1 in each format.
sungremlinfile gremlinfile
0 240.00 128.00 0 240.00 128.00
CENTCENT 2
240.00 128.00 240.00 128.00
185.00 120.00 185.00 120.00
240.00 120.00 240.00 120.00
296.00 120.00 296.00 120.00
* -1.00 -1.00
2 3 2 3
10 A Triangle 10 A Triangle
POLYGON 6
224.00 416.00 224.00 416.00
96.00 160.00 96.00 160.00
384.00 160.00 384.00 160.00
* -1.00 -1.00
5 1 5 1
0 0
-1 -1
Table 1. File examples
The first line of each _g_r_e_m_l_i_n file contains either
the string ggrreemmlliinnffiillee (_A_E_D version) or ssuunnggrreemmlliinn
ffiillee (_S_U_N/_X_1_1)
The second line of the file contains an orienta
tion, and xx and yy values for a positioning point,
separated by spaces. The orientation, either 00 or
11, is ignored by the _S_U_N/_X_1_1 version. 00 means that
_g_r_e_m_l_i_n will display things in horizontal format
(drawing area wider than it is tall, with menu
across top). 11 means that _g_r_e_m_l_i_n will display
things in vertical format (drawing area taller than
it is wide, with menu on left side). xx and yy are
floating point values giving a positioning point to
be used when this file is read into another file.
The stuff on this line really isn't all that impor
tant; a value of ``1 0.00 0.00'' is suggested.
The rest of the file consists of zero or more ele
ment specifications. After the last element speci
fication is a line containing the string ``-1''.
EELLEEMMEENNTT SSPPEECCIIFFIICCAATTIIOONNSS
The first line of each element contains a single
decimal number giving the type of the element (_A_E_D
version) or its ASCII name (_S_U_N/_X_1_1 version). See
Table 2.
_g_r_e_m_l_i_n File Format - Object Type Specification
_A_E_D Number _S_U_N/_X_1_1 Name Description
0 BOTLEFT bottom-left-justified text
1 BOTRIGHT bottom-right-justified text
2 CENTCENT center-justified text
3 VECTOR vector
4 ARC arc
5 CURVE curve
6 POLYGON polygon
10 TOPLEFT top-left-justified text
11 TOPCENT top-center-justified text
12 TOPRIGHT top-right-justified text
13 CENTLEFT left-center-justified text
14 CENTRIGHT right-center-justified text
15 BOTCENT bottom-center-justified text
Table 2.
Type Specifications in _g_r_e_m_l_i_n Files
After the object type comes a variable number of
lines, each specifying a point used to display the
element. Each line contains an x-coordinate and a
y-coordinate in floating point format, separated by
spaces. The list of points is terminated by a line
containing the string ``-1.0 -1.0'' (_A_E_D version)
or a single asterisk, ``*'' (_S_U_N/_X_1_1 version).
After the points comes a line containing two deci
mal values, giving the brush and size for the ele
ment. The brush determines the style in which
things are drawn. For vectors, arcs, and curves
there are six legal brush values:
1 - thin dotted lines
2 - thin dot-dashed lines
3 - thick solid lines
4 - thin dashed lines
5 - thin solid lines
6 - medium solid lines
For polygons, one more value, 0, is legal. It
specifies a polygon with an invisible border. For
text, the brush selects a font as follows:
1 - roman (R font in groff)
2 - italics (I font in groff)
3 - bold (B font in groff)
4 - special (S font in groff)
If you're using _g_r_n to run your pictures through
_g_r_o_f_f, the font is really just a starting font: The
text string can contain formatting sequences like
``\fI'' or ``\d'' which may change the font (as
well as do many other things). For text, the size
field is a decimal value between 1 and 4. It
selects the size of the font in which the text will
be drawn. For polygons, this size field is inter
preted as a stipple number to fill the polygon
with. The number is used to index into a stipple
font at print time.
The last line of each element contains a decimal
number and a string of characters, separated by a
single space. The number is a count of the number
of characters in the string. This information is
only used for text elements, and contains the text
string. There can be spaces inside the text. For
arcs, curves, and vectors, this line of the element
contains the string ``0''.
NNOOTTEESS OONN CCOOOORRDDIINNAATTEESS
_g_r_e_m_l_i_n was designed for _A_E_Ds, and its coordinates reflect
the _A_E_D coordinate space. For vertical pictures, x-values
range 116 to 511, and y-values from 0 to 483. For hori
zontal pictures, x-values range from 0 to 511 and y-values
range from 0 to 367. Although you needn't absolutely
stick to this range, you'll get best results if you at
least stay in this vicinity. Also, point lists are termi
nated by a point of (-1, -1), so you shouldn't ever use
negative coordinates. _g_r_e_m_l_i_n writes out coordinates
using format ``%f1.2''; it's probably a good idea to use
the same format if you want to modify the _g_r_n code.
NNOOTTEESS OONN SSUUNN//XX1111 CCOOOORRDDIINNAATTEESS
There is no longer a restriction on the range of coordi
nates used to create objects in the _S_U_N/_X_1_1 version of
_g_r_e_m_l_i_n. However, files with negative coordinates wwiillll
cause problems if displayed on the _A_E_D.
FFIILLEESS
//uussrr//ffrreeeewwaarree//sshhaarree//ggrrooffff//11..1177..22//ffoonntt//ddeevv_n_a_m_e//DDEESSCC
Device description file for device _n_a_m_e.
SSEEEE AALLSSOO
ggrreemmlliinn(1), ggrrooffff(1), ppiicc(1), iiddeeaall(1)
HHIISSTTOORRYY
David Slattengren and Barry Roitblat wrote the original
Berkeley _g_r_n.
Daniel Senderowicz and Werner Lemberg modified it for
_g_r_o_f_f.
Groff Version 1.17.2 27 June 2001 GRN(1)